
# enter the shell
ssh root@192.168.31.100         # Admin123@pl
# on the agent
mkdir /root/Music
x=yum

$x update
$x upgrade

$x search bpf                   # search the package

$x install ecryptfs-utils libpfm-devel.aarch64 libpfm.aarch64
$x install libpfm.aarch64
$x clean all
$x makecache
yum whatprovides '*bcc/bcc_common.h'
yum whatprovides '*bcc/bcc_common.h'

sudo modprobe ecryptfs          # add the module to the kernel

# see the repos
cat /etc/yum.repos.d/CentOS-Base.repo

# get the protoc compiler
$x install golang-googlecode-goprotobuf.aarch64

pk='ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGhyRIycklSutg/Y8XsC6sMipaPXVfl7PpwEwZNA6h5t me@mypc'
# sudo echo $pk >> /root/.ssh/authorized_keys
mkdir /root/.ssh
sudo bash -c "echo $pk >> /root/.ssh/authorized_keys"

exit
# --------------------------------------------------
# copy the folder
got M
u=192.168.31.70
git remote add hubd http://192.168.31.70:8083/ipfs/managed-server
# congjianer@xinhuaxia.com
# 51682651
scp -r /home/me/repo/managed-server root@192.168.31.100:/root/Music

# --------------------------------------------------
# here
cd /root/Music/
git clone http://192.168.31.70:8083/ipfs/managed-server

# update go (to 1.22 🦜 : Needs > 1.21)
rm -rf /usr/local/go
https_proxy=$px http_proxy=$px wget https://go.dev/dl/go1.22.1.linux-arm64.tar.gz
tar -C /usr/local -xzf go1.22.1.linux-arm64.tar.gz
go version

px='http://192.168.31.178:7890'
# get the protoc-gen-go-grpc
https_proxy=$px http_proxy=$px go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
https_proxy=$px http_proxy=$px go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2

# generate the go code
cd managed-server/go-agent
mkdir generated_pb
n=./generated_pb
protoc --go_out=$n --go_opt=paths=source_relative \
       --go-grpc_out=$n --go-grpc_opt=paths=source_relative \
       hi.proto
# go build && sudo ./a.local --safety=2
https_proxy=$px http_proxy=$px go mod tidy
go build
./a.local --safety=2
